<?
ini_set('error_reporting', E_ALL);
error_reporting(E_ALL);
$fileName=$_GET["filename"];
$extractPath=$_GET["to_path"];

?>

<? 
$fileName=$_GET["filename"];
/*
$zip = zip_open($fileName);

if ($zip) {
  while ($zip_entry = zip_read($zip)) {
    $fp = fopen(zip_entry_name($zip_entry), "w");
    if (zip_entry_open($zip, $zip_entry, "r")) {
      $buf = zip_entry_read($zip_entry, zip_entry_filesize($zip_entry));
      fwrite($fp,"$buf");
      zip_entry_close($zip_entry);
      fclose($fp);
    }
  }
  zip_close($zip);
}

*/


?>
<?
echo "hello";
     $zip = new ZipArchive;
echo "hello1";
     $res = $zip->open($fileName);
     if ($res === TRUE) {
         $zip->extractTo($extractPath);
         $zip->close();
         echo "ok";
     } else {
         echo "failed";
     }
?> 